﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Coding4Fun.Phone.Controls">
	<Style TargetType="local:ColorSliderThumb">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:ColorSliderThumb">
					<Grid>
						<Rectangle 
				            Stroke="Black"
                            StrokeThickness="6" />
						<Rectangle 
				            Stroke="White"
                            StrokeThickness="3" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ColorSliderSuperSlider" TargetType="local:SuperSlider">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:SuperSlider">
					<Grid 
                        x:Name="Body">

						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames
											Storyboard.TargetProperty="Visibility" 
											Storyboard.TargetName="IsEnabledRectangle">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames
											Storyboard.TargetProperty="Fill" 
											Storyboard.TargetName="IsEnabledRectangle">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneChromeBrush}"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames
											Storyboard.TargetProperty="Opacity" 
											Storyboard.TargetName="IsEnabledRectangle">
											<DiscreteObjectKeyFrame KeyTime="0" Value=".5"/>
										</ObjectAnimationUsingKeyFrames>
										<ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Opacity" 
											Storyboard.TargetName="ThumbContentPresenter">
											<DiscreteObjectKeyFrame KeyTime="0" Value=".75"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>

						<Rectangle 
							x:Name="BackgroundRectangle"
							Fill="{TemplateBinding Background}" />
						<Rectangle 
							x:Name="ProgressRectangle"
							Fill="{TemplateBinding Fill}" />
						<Rectangle 
							x:Name="IsEnabledRectangle"
                            Visibility="Collapsed"/>
						<ContentPresenter
							Grid.Row="1"
                            x:Name="ThumbContentPresenter"
							Content="{TemplateBinding Thumb}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="local:ColorSlider">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:ColorSlider">
					<Grid Name="Body">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal" />
								<VisualState x:Name="Disabled">
									<Storyboard>
										<ObjectAnimationUsingKeyFrames
													Storyboard.TargetProperty="Fill" 
													Storyboard.TargetName="SelectedColor">
											<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
										</ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Rectangle 
                            Name="SelectedColor" 
                            Fill="{TemplateBinding SolidColorBrush}" />

						<local:SuperSlider 
                            x:Name="Slider"
                            Orientation="{TemplateBinding Orientation}"
                            Fill="Transparent"
                            Minimum="0"
                            Maximum="360" 
                            Thumb="{TemplateBinding Thumb}"
                            Style="{StaticResource ColorSliderSuperSlider}">
						</local:SuperSlider>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>